from treelib import Tree, Node


tree = Tree()
tree.create_node('A', 'a')
tree.create_node('B', 'b', parent='a')
tree.create_node('C', 'c', parent='a')

node = tree.get_node('b')
node.data = 'New data'

for node in tree.all_nodes():
    print(node.identifier, node.tag, node.data)

tree.show()
